<?php 
session_start();
set_time_limit(9999);
// $conn is of type "ADODB.connection"//创建服务器ADODB对象
$db_link = mysql_connect("localhost","fsdkp","1234") or die('数据库连接失败，请检查连接字符串！');
mysql_select_db("fsdkp",$db_link) or die('数据库连接失败，请检查指定的数据库是否存在！');
mysql_query("set names 'utf8';");
mysql_query("set sql_mode='ANSI'"); //非严格SQL,避免''空值无法插入到数值型字段的问题

$USID="US".$_SERVER['DOCUMENT_ROOT'];
$ULVL="UL".$_SERVER['DOCUMENT_ROOT'];

//关闭数据库调用
function closedatabase() {
	if (isset($db_link)) {mysql_close($db_link);};
	return;
} 


//管理员身份验证
function CheckAdmin() {
	if (empty($_SESSION['adminname']) || !isset($_SESSION['adminname']) ) {return false;}
	$sql="Select * from admin where admin_name='".$_SESSION['adminname']."' LIMIT 0,1";
	$result=mysql_query($sql) ;
	if (mysql_num_rows($result)>0) {
		return true;
	};
	return false;
}

function CheckAdmin2() {
	if (!CheckAdmin()) {
		header("Location: default.php");
		exit;
	}
	return true;
}



$sql="select * from guild";
$result=mysql_query($sql);
$guildrow = mysql_fetch_array($result);
//echo $guildrow["guild_para"];
$ArrGuildPara = explode("|",$guildrow["guild_para"]);
$GuildName=$guildrow["guild_name"];
$GuildsName=$guildrow["guild_sname"];
$GuildServer=$guildrow["guild_server"];
$StylePath="style";
//$StylePath=$guildrow["guild_style"];
$IconPath=$ArrGuildPara[1];
$IconExt=$ArrGuildPara[2];
$Precision=$ArrGuildPara[3];
$lvlGBook=$ArrGuildPara[4];
?>
